﻿@using RielAp.Domain.Models
@model RielAp.Web.Areas.Admin.Models.UsersViewModel
@{
    ViewBag.Title = "Users";
    ViewBag.AdminCurrentPage = RielAp.Web.Areas.Admin.Models.AdminViewType.Users;
    Layout = "~/Areas/Admin/Views/Shared/_DefaultLayout.cshtml";
}

@if (Model.Users.Count()>0){
    <table class="table">
    
    @foreach (User user in Model.Users) 
    {
        <tr>
            <td>
                <div class="row-fluid">
                    <strong>@user.Username.ToString()</strong>
                </div>
                <div class="row-fluid">
                    <span class="bfh-phone" data-format="+dd (ddd) ddd-dddd" data-number="@user.Phone"></span>
                    @foreach (RielAp.Domain.Models.MobileNumber mn in user.AdditionalNumbers) { 
                        <span>, </span>
                        <span class="bfh-phone" data-format="+dd (ddd) ddd-dddd" data-number="@mn.Number"></span>
                    }
                </div>
                <div class="row-fluid">
                    Announcements Number: @user.Apartments.Count
                </div>
            </td>

            <td>
                <div class="row-fluid">
                    <strong>@user.EmailAddress</strong>
                </div>
                <div class="row-fluid">
                    @user.Profile.ProfileName
                </div>
                <div class="row-fluid">
                    @user.ProfileExpires.ToString()
                </div>
            </td>

            <td>
                <div class="btn-group btn-group-vertical">
                    <a class="btn btn-primary">Orders</a>
                    <a class="btn btn-primary">Announcements</a>
                    <a class="btn btn-primary">Edit</a>
                </div>
            </td>
        </tr>
    }

    </table>
}
else{
    <div style="width: 100%; display: block; text-align:center; font-size: 22px; font-style: italic; color: #777;">
        @RielAp.Translation.Translation.NoSearchResults
    </div>
}

